home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Online / cnetdevice / src / include / ref / i82365.h < prev    next >
C/C++ Source or Header  |  1996-05-17  |  9KB  |  191 lines

  1. #ifndef __83265_H__
  2. #define __83265_H__
  3.  
  4. /***********************************************************************
  5.  * 82365.h -- information necessary for direct manipulation of PCMCIA
  6.  * cards and controllers
  7.  *
  8.  * Support is included for Intel 82365SL PCIC controllers and clones
  9.  * thereof.
  10.  *
  11.  * originally by Barry Jaspan; hacked over by Keith Moore
  12.  *
  13.  ***********************************************************************/
  14.  
  15. /*
  16.  * PCIC Registers
  17.  *     Each register is given a name, and most of the bits are named too.
  18.  *     I should really name them all.
  19.  *
  20.  *     Finally, since the banks can be addressed with a regular syntax,
  21.  *     some macros are provided for that purpose.
  22.  */
  23.  
  24. #define PCIC_BASE 0x03e0    /* base adddress of pcic register set */
  25.  
  26. /* First, all the registers */
  27. #define PCIC_ID_REV    0x00    /* Identification and Revision */
  28. #define PCIC_STATUS    0x01    /* Interface Status */
  29. #define PCIC_POWER    0x02    /* Power and RESETDRV control */
  30. #define PCIC_INT_GEN    0x03    /* Interrupt and General Control */
  31. #define PCIC_STAT_CHG    0x04    /* Card Status Change */
  32. #define PCIC_STAT_INT    0x05    /* Card Status Change Interrupt Config */
  33. #define PCIC_ADDRWINE    0x06    /* Address Window Enable */
  34. #define PCIC_IOCTL    0x07    /* I/O Control */
  35. #define PCIC_IO0_STL    0x08    /* I/O Address 0 Start Low Byte */
  36. #define PCIC_IO0_STH    0x09    /* I/O Address 0 Start High Byte */
  37. #define PCIC_IO0_SPL    0x0a    /* I/O Address 0 Stop Low Byte */
  38. #define PCIC_IO0_SPH    0x0b    /* I/O Address 0 Stop High Byte */
  39. #define PCIC_IO1_STL    0x0c    /* I/O Address 1 Start Low Byte */
  40. #define PCIC_IO1_STH    0x0d    /* I/O Address 1 Start High Byte */
  41. #define PCIC_IO1_SPL    0x0e    /* I/O Address 1 Stop Low Byte */
  42. #define PCIC_IO1_SPH    0x0f    /* I/O Address 1 Stop High Byte */
  43. #define PCIC_SM0_STL    0x10    /* System Memory Address 0 Mapping Start Low Byte */
  44. #define PCIC_SM0_STH    0x11    /* System Memory Address 0 Mapping Start High Byte */
  45. #define PCIC_SM0_SPL    0x12    /* System Memory Address 0 Mapping Stop Low Byte */
  46. #define PCIC_SM0_SPH    0x13    /* System Memory Address 0 Mapping Stop High Byte */
  47. #define PCIC_CM0_L    0x14    /* Card Memory Offset Address 0 Low Byte */
  48. #define PCIC_CM0_H    0x15    /* Card Memory Offset Address 0 High Byte */
  49. #define PCIC_CDGC    0x16    /* Card Detect and General Control */
  50. #define PCIC_RES17    0x17    /* Reserved */
  51. #define PCIC_SM1_STL    0x18    /* System Memory Address 1 Mapping Start Low Byte */
  52. #define PCIC_SM1_STH    0x19    /* System Memory Address 1 Mapping Start High Byte */
  53. #define PCIC_SM1_SPL    0x1a    /* System Memory Address 1 Mapping Stop Low Byte */
  54. #define PCIC_SM1_SPH    0x1b    /* System Memory Address 1 Mapping Stop High Byte */
  55. #define PCIC_CM1_L    0x1c    /* Card Memory Offset Address 1 Low Byte */
  56. #define PCIC_CM1_H    0x1d    /* Card Memory Offset Address 1 High Byte */
  57. #define PCIC_GLO_CTRL    0x1e    /* Global Control Register */
  58. #define PCIC_RES1F    0x1f    /* Reserved */
  59. #define PCIC_SM2_STL    0x20    /* System Memory Address 2 Mapping Start Low Byte */
  60. #define PCIC_SM2_STH    0x21    /* System Memory Address 2 Mapping Start High Byte */
  61. #define PCIC_SM2_SPL    0x22    /* System Memory Address 2 Mapping Stop Low Byte */
  62. #define PCIC_SM2_SPH    0x23    /* System Memory Address 2 Mapping Stop High Byte */
  63. #define PCIC_CM2_L    0x24    /* Card Memory Offset Address 2 Low Byte */
  64. #define PCIC_CM2_H    0x25    /* Card Memory Offset Address 2 High Byte */
  65. #define PCIC_RES26    0x26    /* Reserved */
  66. #define PCIC_RES27    0x27    /* Reserved */
  67. #define PCIC_SM3_STL    0x28    /* System Memory Address 3 Mapping Start Low Byte */
  68. #define PCIC_SM3_STH    0x29    /* System Memory Address 3 Mapping Start High Byte */
  69. #define PCIC_SM3_SPL    0x2a    /* System Memory Address 3 Mapping Stop Low Byte */
  70. #define PCIC_SM3_SPH    0x2b    /* System Memory Address 3 Mapping Stop High Byte */
  71. #define PCIC_CM3_L    0x2c    /* Card Memory Offset Address 3 Low Byte */
  72. #define PCIC_CM3_H    0x2d    /* Card Memory Offset Address 3 High Byte */
  73. #define PCIC_RES2E    0x2e    /* Reserved */
  74. #define PCIC_RES2F    0x2f    /* Reserved */
  75. #define PCIC_SM4_STL    0x30    /* System Memory Address 4 Mapping Start Low Byte */
  76. #define PCIC_SM4_STH    0x31    /* System Memory Address 4 Mapping Start High Byte */
  77. #define PCIC_SM4_SPL    0x32    /* System Memory Address 4 Mapping Stop Low Byte */
  78. #define PCIC_SM4_SPH    0x33    /* System Memory Address 4 Mapping Stop High Byte */
  79. #define PCIC_CM4_L    0x34    /* Card Memory Offset Address 4 Low Byte */
  80. #define PCIC_CM4_H    0x35    /* Card Memory Offset Address 4 High Byte */
  81. #define PCIC_RES36    0x36    /* Reserved */
  82. #define PCIC_RES37    0x37    /* Reserved */
  83. #define PCIC_RES38    0x38    /* Reserved */
  84. #define PCIC_RES39    0x39    /* Reserved */
  85. #define PCIC_RES3A    0x3a    /* Reserved */
  86. #define PCIC_RES3B    0x3b    /* Reserved */
  87. #define PCIC_RES3C    0x3c    /* Reserved */
  88. #define PCIC_RES3D    0x3d    /* Reserved */
  89. #define PCIC_RES3E    0x3e    /* Reserved */
  90. #define PCIC_RES3F    0x3f    /* Reserved */
  91.  
  92. /* Now register bits, ordered by reg # */
  93.  
  94. /* For Identification and Revision (PCIC_ID_REV) */
  95. #define PCIC_INTEL0    0x82    /* Intel 82365SL Rev. 0; Both Memory and I/O */
  96. #define PCIC_INTEL1    0x83    /* Intel 82365SL Rev. 1; Both Memory and I/O */
  97. #define PCIC_IBM1    0x88    /* IBM PCIC clone; Both Memory and I/O */
  98. #define PCIC_IBM2    0x89    /* IBM PCIC clone; Both Memory and I/O */
  99.  
  100. /* For Interface Status register (PCIC_STATUS) */
  101. #define PCIC_VPPV    0x80    /* Vpp_valid */
  102. #define PCIC_POW    0x40    /* PC Card power active */
  103. #define PCIC_READY    0x20    /* Ready/~Busy */
  104. #define PCIC_MWP    0x10    /* Memory Write Protect */
  105. #define PCIC_CD        0x0C    /* Both card detect bits */
  106. #define PCIC_BVD    0x03    /* Both Battery Voltage Detect bits */
  107.  
  108. /* For the Power and RESETDRV register (PCIC_POWER) */
  109. #define PCIC_OUTENA    0x80    /* Output Enable */
  110. #define PCIC_DISRST    0x40    /* Disable RESETDRV */
  111. #define PCIC_APSENA    0x20    /* Auto Pwer Switch Enable */
  112. #define PCIC_PCPWRE    0x10    /* PC Card Power Enable */
  113.  
  114. /* For the Interrupt and General Control register (PCIC_INT_GEN) */
  115. #define PCIC_CARDTYPE    0x20    /* Card Type 0 = memory, 1 = I/O */
  116. #define        PCIC_IOCARD    0x20
  117. #define        PCIC_MEMCARD    0x00
  118. #define PCIC_CARDRESET    0x40    /* Card reset 0 = Reset, 1 = Normal */
  119.  
  120. /* For the Card Status Change register (PCIC_STAT_CHG) */
  121. #define PCIC_CDTCH    0x08    /* Card Detect Change */
  122. #define PCIC_RDYCH    0x04    /* Ready Change */
  123. #define PCIC_BATWRN    0x02    /* Battery Warning */
  124. #define PCIC_BATDED    0x01    /* Battery Dead */
  125.  
  126. /* For the Address Window Enable Register (PCIC_ADDRWINE) */
  127. #define PCIC_SM0_EN    0x01    /* Memory Window 0 Enable */
  128. #define PCIC_SM1_EN    0x02    /* Memory Window 1 Enable */
  129. #define PCIC_SM2_EN    0x04    /* Memory Window 2 Enable */
  130. #define PCIC_SM3_EN    0x08    /* Memory Window 3 Enable */
  131. #define PCIC_SM4_EN    0x10    /* Memory Window 4 Enable */
  132. #define PCIC_MEMCS16    0x20    /* ~MEMCS16 Decode A23-A12 */
  133. #define PCIC_IO0_EN    0x40    /* I/O Window 0 Enable */
  134. #define PCIC_IO1_EN    0x80    /* I/O Window 1 Enable */
  135.  
  136. /* For the I/O Control Register (PCIC_IOCTL) */
  137. #define PCIC_IO0_16BIT    0x01    /* I/O to this segment is 16 bit */
  138. #define PCIC_IO0_CS16    0x02    /* I/O cs16 source is the card */
  139. #define PCIC_IO0_0WS    0x04    /* zero wait states added on 8 bit cycles */
  140. #define PCIC_IO0_WS    0x08    /* Wait states added for 16 bit cycles */
  141. #define PCIC_IO1_16BIT    0x10    /* I/O to this segment is 16 bit */
  142. #define PCIC_IO1_CS16    0x20    /* I/O cs16 source is the card */
  143. #define PCIC_IO1_0WS    0x04    /* zero wait states added on 8 bit cycles */
  144. #define PCIC_IO1_WS    0x80    /* Wait states added for 16 bit cycles */
  145.  
  146. /* For the various I/O and Memory windows */
  147. #define PCIC_ADDR_LOW    0
  148. #define PCIC_ADDR_HIGH    1
  149. #define PCIC_START    0x00    /* Start of mapping region */
  150. #define PCIC_END    0x02    /* End of mapping region */
  151. #define PCIC_MOFF    0x04    /* Card Memory Mapping region offset */
  152. #define PCIC_IO0    0x08    /* I/O Address 0 */
  153. #define PCIC_IO1    0x0c    /* I/O Address 1 */
  154. #define PCIC_SM0    0x10    /* System Memory Address 0 Mapping */
  155. #define PCIC_SM1    0x18    /* System Memory Address 1 Mapping */
  156. #define PCIC_SM2    0x20    /* System Memory Address 2 Mapping */
  157. #define PCIC_SM3    0x28    /* System Memory Address 3 Mapping */
  158. #define PCIC_SM4    0x30    /* System Memory Address 4 Mapping */
  159.  
  160. /* For System Memory Window start registers
  161.    (PCIC_SMx|PCIC_START|PCIC_ADDR_HIGH) */
  162. #define PCIC_ZEROWS    0x40    /* Zero wait states */
  163. #define PCIC_DATA16    0x80    /* Data width is 16 bits */
  164.  
  165. /* For System Memory Window stop registers
  166.    (PCIC_SMx|PCIC_END|PCIC_ADDR_HIGH) */
  167. #define PCIC_MW0    0x40    /* Wait state bit 0 */
  168. #define PCIC_MW1    0x80    /* Wait state bit 1 */
  169.  
  170. /* For System Memory Window offset registers
  171.    (PCIC_SMx|PCIC_MOFF|PCIC_ADDR_HIGH) */
  172. #define PCIC_REG    0x40    /* Attribute/Common select (why called Reg?) */
  173. #define PCIC_WP        0x80    /* Write-protect this window */
  174.  
  175. /* For Card Detect and General Control register (PCIC_CDGC) */
  176. #define PCIC_16_DL_INH    0x01    /* 16-bit memory delay inhibit */
  177. #define PCIC_CNFG_RST_EN 0x02    /* configuration reset enable */
  178. #define PCIC_GPI_EN    0x04    /* GPI Enable */
  179. #define PCIC_GPI_TRANS    0x08    /* GPI Transition Control */
  180. #define PCIC_CDRES_EN    0x10    /* card detect resume enable */
  181. #define PCIC_SW_CD_INT    0x20    /* s/w card detect interrupt */
  182.  
  183. /* For Global Control register (PCIC_GLO_CTRL) */
  184. #define PCIC_PWR_DOWN    0x01    /* power down */
  185. #define PCIC_LVL_MODE    0x02    /* level mode interrupt enable */
  186. #define PCIC_WB_CSCINT    0x04    /* explicit write-back csc intr */
  187. #define PCIC_IRQ14_PULSE 0x08    /* irq 14 pulse mode enable */
  188.  
  189. /* DON'T ADD ANYTHING AFTER THIS #endif */
  190. #endif /* __83265_H__ */
  191.